<?php
class Role extends Doctrine_Record {

	public function setTableDefinition() {
    $this->hasColumn('name', 'string', 64,
    	array(
				'notnull' => true,
    		'comment' => 'Nombre unico para el rol.'
      )
    );
	}
	
	public function setUp() {
		$this->hasMany('RolePermission as permissions', 
			array(
      	'local' => 'role_id',
        'foreign' => 'permission_id',
				'refClass' => 'RolePermission',
      )
    );
    
    $this->hasMany('User as users', 
			array(
      	'local' => 'role_id',
        'foreign' => 'user_id',
				'refClass' => 'UserRole',
      )
    );
	}
	
}
    